package com.adam.masterSpringMVC4.weibo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

@Service
public class WeiboCache {

    @Autowired
    private WeiboService weiboService;

    @Cacheable("searches")
    public List<WeiboData> fetch(String searchType, String keyword) {
        return weiboService.search(keyword);
    }

}
